<?php

/**
 * Evento form base class.
 *
 * @package    form
 * @subpackage evento
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseEventoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cd_evento'        => new sfWidgetFormInputHidden(),
      'cd_tipo_evento'   => new sfWidgetFormDoctrineChoice(array('model' => 'TipoEvento', 'add_empty' => false)),
      'cd_camara'        => new sfWidgetFormDoctrineChoice(array('model' => 'Camara', 'add_empty' => false)),
      'cd_cidade'        => new sfWidgetFormDoctrineChoice(array('model' => 'Cidade', 'add_empty' => false)),
      'nr_evento'        => new sfWidgetFormInput(),
      'dt_hr_inicio'     => new sfWidgetFormDateTime(),
      'dt_hr_termino'    => new sfWidgetFormDateTime(),
      'de_endereco'      => new sfWidgetFormInput(),
      'ic_confirmado'    => new sfWidgetFormInputCheckbox(),
      'extrato'          => new sfWidgetFormTextarea(),
      'pauta'            => new sfWidgetFormInput(),
      'pauta_enviada_em' => new sfWidgetFormDateTime(),
      'ata'              => new sfWidgetFormInput(),
      'ata_enviada_em'   => new sfWidgetFormDateTime(),
      'deleted'          => new sfWidgetFormInputCheckbox(),
      'created_at'       => new sfWidgetFormDateTime(),
      'updated_at'       => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'cd_evento'        => new sfValidatorDoctrineChoice(array('model' => 'Evento', 'column' => 'cd_evento', 'required' => false)),
      'cd_tipo_evento'   => new sfValidatorDoctrineChoice(array('model' => 'TipoEvento')),
      'cd_camara'        => new sfValidatorDoctrineChoice(array('model' => 'Camara')),
      'cd_cidade'        => new sfValidatorDoctrineChoice(array('model' => 'Cidade')),
      'nr_evento'        => new sfValidatorInteger(array('required' => false)),
      'dt_hr_inicio'     => new sfValidatorDateTime(),
      'dt_hr_termino'    => new sfValidatorDateTime(),
      'de_endereco'      => new sfValidatorString(array('max_length' => 255)),
      'ic_confirmado'    => new sfValidatorBoolean(),
      'extrato'          => new sfValidatorString(array('max_length' => 4000, 'required' => false)),
      'pauta'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pauta_enviada_em' => new sfValidatorDateTime(array('required' => false)),
      'ata'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'ata_enviada_em'   => new sfValidatorDateTime(array('required' => false)),
      'deleted'          => new sfValidatorBoolean(),
      'created_at'       => new sfValidatorDateTime(array('required' => false)),
      'updated_at'       => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('evento[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Evento';
  }

}
